package com.qf.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.mapper.DtsOrderMapper;
import com.qf.pojo.DtsOrder;
import com.qf.vo.CategorySellAmts;
import com.qf.vo.DayStatis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * projectName: wokepase1
 *
 * @author: 强力
 * time: 2021/9/13 17:19
 * description:
 */
@Service
public class OrderviceImpl implements  OrderService {
    @Autowired
    private DtsOrderMapper orderMapper;

    @Override
    public Integer ordercount() {
        QueryWrapper<DtsOrder> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("deleted",0);
        Integer count = orderMapper.selectCount(queryWrapper);
        return count;
    }

    @Override
    public List<DayStatis> orderStitis(Integer daysAgo) {
        List<DayStatis> list = orderMapper.statuisIncrOrderCnt(daysAgo);
        return list;
    }

    @Override
    public List<CategorySellAmts> categorySellAmt() {
        List<CategorySellAmts> list = orderMapper.categorySellStatis();
        return list;
    }

    @Override
    public List<Map> selectorder() {
      List<Map> list =orderMapper.queryOrderStat();

        return list;
    }
}
